﻿    <script type="text/javascript">
        $(document).ready(function () {
            var p = new singlepage();
            p.c = "Way.Bus.WMS.Controllers.CheckOrderController";
            p.applyTo = "t1";
            p.onCommandClick = function (command, form, item) {
                if (command == "addroot") {
                    form.setformchilddisabled(true);
                }
                if (command == "add") {
                    form.setformchilddisabled(true);
//                    var box = form.findbox("CODE");
//                    if (item.CC == null)
//                        box.val(item.CODE + "-" + "1");
//                    else
//                        box.val(item.CODE + "-" + (item.CC + 1));
//                    var box1 = form.findbox("WAREHOUSENAME");
//                    box1.fval(item);
//                    box1.setdisabled(true);
//                    var box2 = form.findbox("CHECKORDERTYPE");
//                    box2.val(item.CHECKORDERTYPE);
//                    box2.setdisabled(true);

                }
                if (command == "edit") {
                    if (item.ISSUBMITED && !item.ISREVIEWED) {
                        form.setformdisabled(true);
                        form.setformchilddisabled(false);
                    }
                    else {
                        form.setformchilddisabled(true);
                    }
                    if(item.ISREVIEWED)
                        form.setformdisabled(true);
                }
            }
            p.init();
        });

      </script>
<div id="t1"></div>
